<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>timer button</title>
  <link rel="stylesheet" href="./timer-button.css">
  <link rel="icon" href="https://i.wangding.in/favicon.ico" sizes="48x48" type="image/png">
</head>
<body>
<input type='button' id="add" value='添加定时器按钮'/><hr>
<input type="button" id='del' value='删除定时器按钮'/><hr>
<div id='test'>

</div>
<script src="//apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="./timer-button.js"></script>
<script>
$(()=>{
    let $btnAdd=$('#add'),
        $btnDel=$('#del');
    $btnAdd.click(()=>{
      $timerBtn.show({
        container:'#test',
        title:'发送验证码',
        onClick:function(){console.log('timer button click')}
      });
    });
    $btnDel.click(()=>{
      $timerBtn.destroy();
    });

});
</script>
</body>
</html>
